module Kuztuscms
  class SettingsController < KuztuscmsController
    # GET /settings
    def index
      @settings = Setting.all
    end

    # GET /settings/new
    def new
      @setting = Setting.new
    end

    # GET /settings/1/edit
    def edit
      @setting = Setting.find(params[:id])
    end

    # POST /settings
    def create
      @setting = Setting.new(params[:setting])

      if @setting.save
        redirect_to settings_url, notice: 'Setting was successfully created.'
      else
        render action: "new"
      end
    end

    # PUT /settings/1
    def update
      @setting = Setting.find(params[:id])

      if @setting.update_attributes(params[:setting])
        redirect_to settings_url, notice: 'Setting was successfully updated.'
      else
        render action: "edit"
      end
    end

    # DELETE /settings/1
    def destroy
      @setting = Setting.find(params[:id])
      @setting.destroy

      redirect_to settings_url
    end
  end
end
